package com.ywu.mq.standard.produce;

import com.ywu.mq.sdk.producer.YwuKafkaProducer;
import com.ywu.mq.standard.config.YwuKafkaProduceConfig;
import lombok.Data;
import lombok.ToString;
import org.apache.kafka.clients.producer.RecordMetadata;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @ClassName YwuKafkaProduce
 * @Description TODO
 * @Author GroundDemo
 * @Date 2025/3/28 10:16
 * @Version 1.0
 **/
@Component
@Data
@ToString
public class YwuKafkaProduce extends YwuKafkaProducer {

    @Autowired
    private YwuKafkaProduceConfig config;

    /**
    * @Author GroundDemo
    * @Description 初始化配置
    * @Date 17:57 2025/3/28
    * @Param []
    * @return void
    **/
    @PostConstruct
    public void init() {
        init(config);
    }

    private String key;

    private String value;

    private String topic;

    private String appId;

    public String getAppId() {
        return appId;
    }

    @Override
    public String getKey() {
        return key;
    }

    @Override
    public String getValue() {
        return value;
    }

    @Override
    public String getTopic() {
        return topic;
    }

    @Override
    public void customCallBack(RecordMetadata metadata, Exception exception, String messageId) {

    }
}
